package ltd.sshine.tracking.web.validator;


import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 数字正则
 */
@Target( {ElementType.PARAMETER, ElementType.FIELD})
@Retention(RUNTIME)
@Constraint(validatedBy = NumberPatternValidator.class)
@Documented
public @interface NumberPattern  {
    String message() default "至少有一个属性不可为空";
    String regexp() default "" ;
    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
